<template>
  <router-view />
</template>

<script lang="ts">
import { defineComponent, onMounted, onUnmounted } from 'vue';
import { useCommonStore } from 'stores/commonStore';

export default defineComponent({
  name: 'App',

  setup (props, context) {
    //store
    const commonStore = useCommonStore();

    //挂载组件
    onMounted(() => {
      //menuStore.addRouter();
      console.log('App onMounted!')
    });

    //卸载组件
    onUnmounted(() => {
      //清空sessionStorage
      commonStore.initToken();
      commonStore.initUser();
      commonStore.initMenus();
    });

    return {

    };
  }
});
</script>
